package info.cs52.fes.action.meal;

import info.cs52.fes.FesAction;
import info.cs52.fes.action.MealUtils;
import info.cs52.fes.data.Meal;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RenderAction extends FesAction {

	private List<Meal> meals;
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		List<List<String>> mealList = (List<List<String>>) 
						req.getSession().getAttribute("recommendedMeals");
		if (mealList != null) {
			meals = MealUtils.translate(mealList);
		}
	}

	public List<Meal> getMeals() {
		return meals;
	}
	
}
